Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/issue324 #297

Merged
merged 14 commits into from
Jan 5, 2021
Merged

Bug/issue324 #297

merged 14 commits into from
Jan 5, 2021

Conversation

jassak
Copy link
Contributor

@jassak jassak commented Jan 5, 2021

  • Bug fix (issue324):
    Problem:
    The initialization procedure in LogisticRegression sometimes assigns y values (0 and 1) to different levels of the
    target variable across local nodes. The code which assigns y levels in [0, 1] is y = self.data.variables.iloc[:, 1]
    which is not guarantied to lead to the same values, hence the bug.
    Solution:
    The user inputs the levels he wishes to assign to
    positive and negative outcomes. This also eliminates the need to use
    filters to handle multilevel variables. Only two levels are always
    filter from within the algorithm now (method: keep_levels).

  • Bug fix:
    Problem:
    In some cases all levels of a categorical variable are not present in
    every node. This led to exceptions since the corresponding design
    matrices schemata were not aligned across local nodes.
    Solution:
    Add method for aligning categorical variables across local nodes. Checks
    all categorical columns in design matrices produced by patsy and if any
    level is missing in some local node it adds the corresponding column
    (all zeros since the level was missing originally).
    Caveat:
    Adding non-existing levels to a local nodes, without affecting the record count is only possible in
    design matrices with dummy coding, i.e. in variables and covariables matrices. This is done simply
    by adding all-zero columns for the missing levels. Warning: in the full matrix which in not dummy coded
    the missing levels are still missing!

  • Enhancement: Add more nodes to LogisticRegression and CalibrationBelt tests.

The way it was done resulted in a subtle bug where sometimes the target
levels where not assigned consistently on different nodes.

This is now fixed: The user inputs the levels he wishes to assign to
positive and negative outcomes. This also eliminates the need to use
filters to handle multilevel variables. Only two levels are always
filter from within the algorithm now (method: keep_levels).
Also, correctly escape negative_level and positive_level params.
The Logistic Regression algorithm now accepts input from user for
positive and negative levels, instead of assign them automatically. Thus
the test inputs must include those params instead of a random filter for
two values.
Problem:
--------
In some cases all levels of a categorical variable are not present in
every node. This led to exceptions since the corresponding design
matrices schemata were not aligned across local nodes.

Solution:
---------
Add method for aligning categorical variables across local nodes. Checks
all categorical columns in design matrices produced by patsy and if any
level is missing in some local node it adds the corresponding column
(all zeros since the level was missing originally).
@jassak jassak requested a review from ThanKarab January 5, 2021 09:00
@ThanKarab ThanKarab merged commit 357ab73 into master Jan 5, 2021
@ThanKarab ThanKarab deleted the bug/issue324 branch January 5, 2021 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants